﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace Xpom_Xpum__Browser_Integrator.Subsystems
{
    internal class LoadManager
    {
        internal void LoadExtensionFromDirectory(string browserPath, string directoryPath)
        {
            string arguments = "";
            arguments += "--load-and-launch-app=\"{0}\""; // TODO
            arguments = String.Format(arguments, directoryPath);

            Console.WriteLine(arguments);
            arguments = arguments.TrimEnd(new char[] { '"' });
            Console.WriteLine(arguments);

            ProcessStartInfo browserStartInfo = new ProcessStartInfo();
            browserStartInfo.FileName = browserPath;
            browserStartInfo.Arguments = arguments;

            Process browserProcess = new Process();
            browserProcess.StartInfo = browserStartInfo;
            browserProcess.Start();
        }
    }
}
